home *** CD-ROM | disk | FTP | other *** search
/ Amoszine 8 / Amoszine 8 (Disk 2 of 3).adf / Powerbobs.lha / powerbobsv1.0 / examples / MulShift_Array.Asc < prev    next >
Text File  |  1995-06-30  |  892b  |  45 lines

  1. Set Buffer 20
  2. Screen Open 0,320,256,32,L
  3. Dim X(4000),_SIN(360)
  4. For I=0 To 4000
  5.    X(I)=I
  6. Next 
  7. Degree 
  8. For I=0 To 360
  9.    _SIN(I)=Sin(I)*1024
  10. Next 
  11. Input "Enter angle (0 -> 359) : ";ANGLE
  12. Locate 0,0
  13. _SINUS=_SIN(ANGLE)
  14. T=Timer
  15. Pmul Shift Varptr(X(0)),Varptr(X(0)),_SINUS,10,0 To 4000
  16. Print "Time used with new routine :";Timer-T
  17. For I=1 To 10
  18.    Locate 2,I+5 : Print X(I)
  19. Next 
  20. For I=3990 To 4000
  21.    Locate 2,I-3974 : Print X(I)
  22. Next 
  23. For I=0 To 4000
  24.    X(I)=I
  25. Next 
  26. T=Timer
  27. For I=0 To 4000
  28.    X(I)=(X(I)*_SINUS)/1024
  29. Next 
  30. Locate 0,1
  31. Print "Time used with scaled Amos :";Timer-T
  32. Cdown 
  33. Print "First ten values..."
  34. For I=1 To 10
  35.    Locate 15,I+5 : Print X(I)
  36.    Locate 28,I+5 : Print I*Sin(ANGLE)
  37. Next 
  38. Print "Last ten values..."
  39. For I=3991 To 4000
  40.    Locate 15,I-3974 : Print X(I)
  41.    Locate 28,I-3974 : Print I*Sin(ANGLE)
  42. Next 
  43. Locate 0,5 : Print "PowerBobs    Scaled Amos   Normal Amos"
  44. End 
  45.